[#ftl]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>[#assign module]project/${item.scope.id}/classes[/#assign][#assign moduleName="动态类"]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>[#if (item.id)??]编辑${moduleName}信息[#else]添加新${moduleName}[/#if]</title>
<script type="text/javascript" src="${base}/commonjs/jquery1.7.2/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="${base}/commonjs/jquery-forms.js"></script>
<script type="text/javascript" src="${base}/commonjs/jquery.select.js"></script>
<script type="text/javascript" src="${base}/commonjs/artDialog4/artDialog.source.js?skin=blue"></script>
<script type="text/javascript" src="${base}/commonjs/artDialog4/plugins/iframeTools.source.js"></script>
<script type="text/javascript">
$(function(){
    $("#selectOwnerLevel").createSelect([[0,"全局数据"],[1,"会务数据"],[2,"分组数据"],[3,"用户数据"]], ${(item.ownerLevel)});
	$("#selectScopeClass").createSelect("${base}/${module}/list", {
        pageNo:1,pageSize:999
    }, function(row){
        return [row.id, row.cell[1]];
    }, ${(item.scopeClass.id)!0});
    $("#select_suits").createSelect("${base}/suits/list", {
        pageNo:1,pageSize:999
    }, function(row){
        return [row.id, row.cell[1]];
    }, ${(item.suit.id)!0});
	$("#btadditem").bind("click", function(){
		$("#additemform").ajaxForm({
			dataType: "json",
			success: function(json){
				if(!json.success){
					art.dialog.through({
						title: "[#if (item.id)??]编辑${moduleName}信息[#else]添加新${moduleName}[/#if]失败",
						icon: "error",
						content: "[#if (item.id)??]编辑${moduleName}信息[#else]添加新${moduleName}[/#if]失败！<br>"+json.err,
						width: 250,
						height: 150,
						background: '#EEE', // 背景色
						opacity: 0.05,	// 透明度
						lock: true,
						ok: true
					});
				}else{
					try{
						art.dialog.top.frames["_iframe"].window.flexGridReload(".flexme3");
					}catch(e){
					   try{
					       art.dialog.open.origin.flexGridReload(".flexme3");
					   }catch(e){
					       art.dialog.top.window.flexGridReload(".flexme3");
					   }
					}
					art.dialog.close();
				}
			}
		});
	});
});
</script>
</head>
<body>
<h3>[#if (item.id)??]编辑${moduleName}信息[#else]添加新${moduleName}[/#if]</h3>
<form id="additemform" action="${base}/${module}/${((item.id)??)?string('edit','add')}" method="POST">
<input type="hidden" name="id" value=${(item.id)!}>
${moduleName}名:<input type="text" name="name" value="${(item.name)!}"/><br>
类名:<input type="text" name="className" value="${(item.className)!}"/><br>
资源（单数）:<input type="text" name="entryName" value="${(item.entryName)!}"/><br>
资源（复数）:<input type="text" name="entryNames" value="${(item.entryNames)!}"/><br>
数据库表名：<input type="text" name="tableName" value="${(item.tableName)!}"/><br>
表名别名：<input type="text" name="tableAlias" value="${(item.tableAlias)!}"/><br>
数据层级：<select id="selectOwnerLevel" name="ownerLevel"></select><br>
主类:<select id="selectScopeClass" name="scopeClass.id"><option value="">--没有主类--</option></select><br>
描述:<textarea rows="3" cols="35" name="description">${(item.description)!}</textarea><br>
套件:<select id="select_suits" name="suit.id"><option value="">--无需渲染--</option></select><br>

<input type="submit" value="[#if (item.id)??]保存${moduleName}信息[#else]保存新${moduleName}[/#if]" id="btadditem">
</form>
</body>
</html>